<%--
    Document   : listVehicleTypes
    Created on : May 12, 2009, 1:36:09 PM
    Author     : Viet Bui
--%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<c:set var="title" value="List Vehicle Types" scope="page"/>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>${title}</title>
    </head>
    <body>
        <h1>${title}</h1>
        <f:view>
            <!-- Show error messages -->
            <h:messages showSummary="true" showDetail="false" style="color: red; font-family: 'New Century Schoolbook', serif; font-style: oblique" id="errors" />

            <h:form>
                <h:dataTable id="vehicleTypesTable" value="#{VehicleTypeJSFManagedBean.vehicleTypes}" var="vehicleType">
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Code"/>
                        </f:facet>
                        <h:outputText value=" #{vehicleType.code}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Description"/>
                        </f:facet>
                        <h:outputText value=" #{vehicleType.description}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Seats"/>
                        </f:facet>
                        <h:outputText value=" #{vehicleType.seats}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Actions"/>
                        </f:facet>
                        <h:commandLink value="Edit" action="#{VehicleTypeJSFManagedBean.editVehicleType}">
                            <f:param name="vehicleTypeId" value="#{vehicleType.id}"/>
                        </h:commandLink>
                        <h:outputText value="  |  "/>
                        <h:commandLink value="Delete" action="#{VehicleTypeJSFManagedBean.deleteVehicleType}">
                            <f:param name="vehicleTypeId" value="#{vehicleType.id}"/>
                        </h:commandLink>
                    </h:column>
                </h:dataTable>
            </h:form>
        </f:view>
    </body>
</html>
